//
//  UserLoginRegistionBackground.swift
//  SitPosition
//
//  Created by apple on 2018/12/31.
//  Copyright © 2018 apple. All rights reserved.
//

import Foundation
import UIKit


class UserLoginRegistrationBackground : UIView {
    
    lazy var gradientLayer: CAGradientLayer = {
        let layer = CAGradientLayer()
        layer.startPoint = CGPoint(x: 0.5, y: 0)
        layer.endPoint = CGPoint(x: 0.5, y: 1)
        layer.colors = [
            UIColor(hexString: "#3466C9", alpha: 1).cgColor,
            UIColor(hexString: "#366AD2", alpha: 1).cgColor
        ]
        return layer
    }()
    
    override func didMoveToSuperview() {
        if gradientLayer.superlayer == nil {
            gradientLayer.frame = layer.bounds
            layer.addSublayer(gradientLayer)
        }
        super.didMoveToSuperview()
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        gradientLayer.frame = layer.bounds
    }
}
